#ifndef SKILL_H
#define SKILL_H

#include <string>
#include <vector>
#include <map>

#define invalid_skill -1

struct SubSkill
{
    int id;
    int level;
    int attack;
    int attackadd;
    int hitrate;
    int defense;
    int betterattack;
    int miss;
    int unknown;
    std::string desc;
};

enum eSkillType
{
    skill_fist = 0,
    skill_weapon,
    skill_light,
    skill_inside,
    skill_block,
    skill_knowledge,
    skill_magic,
    skill_num,
};

typedef std::vector<SubSkill> SubSkillVec;
struct Skill;
typedef std::vector<Skill> SkillVec;
typedef std::map<int,Skill> SkillMap;

struct Skill
{
    int id;
    int type;
    std::string name;
    int weapontype;
    SubSkillVec subskills;
    
    static SkillMap skills;
    static void Init();
    static void LoadSkills();
    static bool IsValidSkill( int type );
    static Skill *GetSkill( int skillid );
    static bool IsBaseSkill( int skillid );
	static int GetBaseSkillIdByWeapon( int weapon );
	static int GetBaseLight() { return 7; }
	static int GetBaseInside() { return 0; }
	static int GetBaseBlock() { return 8; }
	static int GetBaseKnowledge() { return 9; }
	static int GetBaseMagic() { return 4; }
	static int GetBaseFist() { return 1; }
	static const char*GetSkillName( int skilltype );
	static const char *slotnames[skill_num];
};

#endif